package com.goods.dao;

import com.goods.pojo.Product;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ProductMapper {
    @Select("select * from goods")
    public List<Product> getProducts();

    @Insert("insert into goods (name, price , number,`describe`) values (#{name},#{price},#{number},#{describe})")
    public int addProduct(Product product);

    @Delete("delete from goods where id = #{id}")
    public int deleteProduct(int id);

    @Update("UPDATE goods SET name = #{name}, price = #{price}, `describe` = #{describe} WHERE id = #{id}")
    public int updateProduct(Product product);
}
